#!/bin/bash
FILE_PFX=all-sent-no-norm
INCR=5

if [ ! -f $FILE_PFX ]
then
	echo "Creating Prefix File: Starts"
	grep -h -v "^HEADER" ../../Analysis/*.sent|awk -F"	" '{for(i=2;i<=NF;i++){printf("%s\t",$i);}printf("\n");}'|sort -u|./formatData.py|sort -k 1.7,1.10 -k 1.1,1.2 -k 1.3,1.4 >$FILE_PFX
	echo "Creating Prefix File: Ends"
fi

for ((i=5;i<=400;i=i+INCR))
do
	OUT_FILE_NAME=${FILE_PFX}-$i
	if [ ! -f $OUT_FILE_NAME ]
	then
		echo "Formatting File $OUT_FILE_NAME: Starts"
		cat $FILE_PFX|./movingAvg.py  $i >$OUT_FILE_NAME
		echo "Formatting File $OUT_FILE_NAME: Ends"
	fi
done
